#include "systick.h"


void SysTick_Nms(uint32_t Nms)
{
 if(Nms>1864)Nms=1864;
 
 SysTick->CTRL=0;
 SysTick->LOAD=Nms*9000-1;
 SysTick->CTRL=0X01;
 while((SysTick->CTRL&(1<<16))==0);
 SysTick->CTRL=0;
 SysTick->VAL=0;
 }

void SysTick_Delay_Nus(uint32_t Nus)
{
    if(Nus>1864000)Nus=1864000;
    SysTick->CTRL=0;
	SysTick->LOAD=Nus*9-1;
	SysTick->CTRL=0x01;
	while(!(SysTick->CTRL & (1<<16))==0);
	SysTick->CTRL=0;
	SysTick->VAL=0;
	
}

